#唐门优测
#道长最帅666
""
"""
1，鼠标事件
ActionChains(driver):
    driver:webdriver实例执行用户操作
    ActionChains：ActionChains用于生成用户的行为，所有的行为都存储在ActionChains对象上
    再通过perform()执行所有ActionChains中存储的行为。

"""
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
import time
#实例化浏览器驱动
driver = webdriver.Chrome()
driver.maximize_window()
driver.get('http://www.baidu.com')
driver.find_element_by_id('kw').send_keys('唐门')

#右击
ele = driver.find_element_by_id('kw')
ActionChains(driver).context_click(ele).perform()
#双击
ele = driver.find_element_by_id('kw')
ActionChains(driver).double_click(ele).perform()
#鼠标悬浮在一个元素上
ele = driver.find_element_by_id('kw')
ActionChains(driver).move_to_element(ele).perform()
#

